package FWK.core;

import java.awt.Component;

import javax.swing.JOptionPane;

import org.apache.log4j.Logger;

public class FwkErrorMannager {
	private static Logger logger = Logger.getLogger(FwkErrorMannager.class);

	public static void error(Exception e, String msj, Component parent) {
		logger.error(msj, e);
		if (parent != null) {
			try {
				JOptionPane.showInternalMessageDialog(parent, msj, "Error", JOptionPane.ERROR_MESSAGE);
			} catch (RuntimeException e2) {
				JOptionPane.showMessageDialog(null, msj, "Error", JOptionPane.ERROR_MESSAGE);
			}
		} else {
			JOptionPane.showMessageDialog(null, msj, "Error", JOptionPane.ERROR_MESSAGE);
		}
	}
}
